import { Entity, Column, PrimaryGeneratedColumn,ManyToMany, ManyToOne, JoinColumn, OneToOne , BaseEntity, OneToMany } from 'typeorm';
import { Platform } from '../platform/platform.entity';
import { Video } from '../video/video.entity'
import { EnumInternetCelebrityOverseasEnum } from './internetCelebrity.enum';

@Entity('internet_celebrity')
export class InternetCelebrity extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'name' })
  name: string;

  @Column({ name: 'create_time' })
  create_time: Date;

  @Column({ name: 'platform' })
  platform: number;

  @Column({ name: 'ic_group' })
  ic_group: number | null;

  @Column({ name: 'wx_user' })
  wx_user: string;

  @Column({ name: 'img' })
  img: string;

  @Column({ name: 'img_id' })
  img_id: string;
  
  @Column({ name: 'avatar_img' })
  avatar_img: string;

  @Column({ name: 'avatar_id' })
  avatar_id: string;

  @Column({ name: 'account' })
  account: string;

  @Column({ name: 'repeat' })
  repeat: string;

  //是否是海外素材 0：不是 1：是
  @Column({ name: 'overseas' })
  overseas: EnumInternetCelebrityOverseasEnum;
  

  @OneToMany(() => Video, (ic) => ic.ic_info)
  video_: Video[];

  @ManyToOne(() => Platform, (icInfo) => icInfo.id)
  @JoinColumn({name:'platform'})
  platform_: Platform;

}
